<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../../static/css/main.css">
    <script type="text/javascript" src="../../static/js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="../../static/js/main.js"></script>

    <title>hy的web</title>
</head>
<body>
<header>
    <!--头部-->
    <div class="box">
        <img src="../../static/img/logo.png" class="logo">
        <!--导航栏-->
        <div class="right bar">
            <!--选项-->
            <a href="{{ url_for('index_blu.index') }}" class="home_b"><img src="../../static/img/home.png"></a>
            <a href="{{ url_for('user_blu.user_write_new') }}" class=""><img src="../../static/img/write.png"></a>
            <a href="{{ url_for('user_blu.user') }}" class="ava_b"><img src="{{ava}}"></a>
            {%if user%}
            <a href="/passport/logout"><img src="../../static/img/logout.png"></a>
            {%endif%}
        </div>
    </div>
</header>
<div class="user_box">
    <div class="box">
        <ul class="left">
            <li class="user_box_name">{{writer.nick_name}}</li>
            <li class="user_box_sign">
                {{writer.sign}}
            </li>
        </ul>
        <img src="../../static/img/user.png">
        <table class="right user_table">
            <tr>
                <td>文章</td>
                <td>收藏</td>
                <td>粉丝</td>
                <td>关注</td>
            </tr>
            <tr>
                <td>{{writer.article.count()}}</td>
                <td>{{writer.collects.count()}}</td>
                <td>{{writer.fans.count()}}</td>
                <td>{{writer.focus.count()}}</td>
            </tr>
            <tr>
                <td colspan="3">
                    <div class=" follow_writer" value={{writer.id}}>
                        {%if user in writer.fans %}
                        <a href="#">取消关注</a>
                        {%else%}
                        <a href="#">关注</a>
                        {%endif%}
                    </div>
                </td>
            </tr>
        </table>
    </div>
</div>
<div class="box centre">
    <div>
        <ul class="blog_list">
            {% for i in article %}
            <li class="blog">
                <a href="/to_detail/{{i.id}}" class="article_title"><h3>{{i.title}}</h3></a>
                {{i.content[:50]}}......
                <br><br>
                <a href="/to_writer/{{i.user_id}}" class="left article_writer"><img src="{{i.user.avatar_url}}">{{i.user.nick_name}}</a>
                <a href="#" class="right">
                    <img src="../../static/img/clicks.png">{{i.clicks}}<!--浏览-->
                    <img src="../../static/img/like.png">{{i.like}} <!--点赞-->
                    <img src="../../static/img/coll.png">{{i.collect}}<!--收藏-->
                </a>
            </li>
            {% endfor %}
        </ul>
    </div>
</div>

</body>
</html>